﻿<Application
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"       
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:converters="clr-namespace:ArmoryBrowser.Converters"
    xmlns:viewModel="clr-namespace:ArmoryBrowser.ViewModels"
        xmlns:nav="clr-namespace:System.Windows.Navigation;assembly=Microsoft.Phone"
    xmlns:local="clr-namespace:ArmoryBrowser" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" 
    x:Class="ArmoryBrowser.App"
    >

    <!--Application Resources-->
    <Application.Resources>
        <DataTemplate x:Key="templateIconoItemIzda" >
            <Grid Height="70" Width="70">
        		<Image Margin="0" Source="default.png" Stretch="Fill"/>
        		<Image Source="{Binding IconPath}" d:LayoutOverrides="Width, Height" />
        	</Grid>
        </DataTemplate>
        <DataTemplate x:Key="templateIconoItemDcha" >
            <Grid Height="70" Width="70">
        		<Image Margin="0" Source="default.png" Stretch="Fill"/>
        		<Image Source="{Binding IconPath}" Stretch="UniformToFill"  d:LayoutOverrides="Width, Height"  />
        	</Grid>
        </DataTemplate>
        <DataTemplate x:Key="templateTalento">
            <Grid d:DesignWidth="81.5" d:DesignHeight="75">
            	<Grid.RowDefinitions>
            		<RowDefinition />        	
					<RowDefinition />
				</Grid.RowDefinitions>
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="Auto" />
					<ColumnDefinition />
				</Grid.ColumnDefinitions>
        		<TextBlock Text="{Binding Prim}" Grid.ColumnSpan="2" Margin="0" VerticalAlignment="Center"/>
        		<Image Source="{Binding IconPath}" Height="27" HorizontalAlignment="Left" Grid.Row="1"/>
        		<StackPanel Orientation="Horizontal" d:LayoutOverrides="Width" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Center" Margin="0">
        			<TextBlock Text="{Binding TreeOne}"/>
        			<TextBlock Text=","/>
        			<TextBlock Text="{Binding TreeTwo}"/>
        			<TextBlock Text=","/>
        			<TextBlock Text="{Binding TreeThree}"/>
        		</StackPanel>
        	</Grid>
        </DataTemplate>
        <DataTemplate x:Key="templateProfesion">
        	<Grid>
        		<Grid.ColumnDefinitions>
        			<ColumnDefinition Width="auto"/>
        			<ColumnDefinition Width="*"/>
        		</Grid.ColumnDefinitions>
				<Grid.RowDefinitions>
					<RowDefinition />
					<RowDefinition />
				</Grid.RowDefinitions>
        		<Image Grid.Column="0" local:GifLoadingBehavior.ImageUrl="{Binding IconPath}" Margin="5" Grid.Row="1" Width="30" Height="30"/>
        		<TextBlock Text="{Binding Name}" Margin="0" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.ColumnSpan="2" FontWeight="Bold"/>
        		<TextBlock Text="{Binding Value}" Margin="0" VerticalAlignment="Center" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Center"/>
        	</Grid>
        </DataTemplate>
        <viewModel:MainPageViewModel x:Key="model"/>
        <converters:IsNotNullVisibilityConverter x:Key="isNotNullVisibilityConverter" />
        <nav:UriMapper x:Key="UriMapper">
            <nav:UriMapping Uri="/Page/{page}" MappedUri="/{page}.xaml"/>
        </nav:UriMapper>
    </Application.Resources>

    <Application.ApplicationLifetimeObjects>
        <!--Required object that handles lifetime events for the application-->
        <shell:PhoneApplicationService 
            Launching="Application_Launching" Closing="Application_Closing" 
            Activated="Application_Activated" Deactivated="Application_Deactivated"/>
    </Application.ApplicationLifetimeObjects>

</Application>